package Demo;

public class Demo08 {
    public static void main(String[] args) {
        /**
         * 逻辑运算符
         * 逻辑与 & 两边为真才为真
         * 逻辑或 | 一边为真就为真
         * 逻辑非 ！ 取反
         * 短路与 && 两边为真才为真 测试一边为false时发生短路现象 不用运算另一边
         * 短路或 || 一边为真就为真 检测一边为true时发生短路现象，不用运算另一边
         * 异或 ^  两边相同为false 两边不同为true
         * */

        int a = 3, b = 4,c = 5;
        System.out.println((a>b)&(b>c));
        System.out.println((a>b)&(b<c));
        System.out.println((a<b)&(b>c));
        System.out.println((a<b)&(b<c));

        System.out.println("........................");

        System.out.println((a>b)|(b>c));
        System.out.println((a>b)|(b<c));
        System.out.println((a<b)|(b>c));
        System.out.println((a<b)|(b<c));

        System.out.println("........................");

        System.out.println(!(b>c));

        System.out.println("........................");

        System.out.println((a>b)^(b>c));
        System.out.println((a>b)^(b<c));
        System.out.println((a<b)^(b>c));
        System.out.println((a<b)^(b<c));
    }
}
